package my.edu.model.bills.purchase.entity.dto;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import jakarta.validation.groups.Default;
import lombok.Data;
import lombok.EqualsAndHashCode;
import my.edu.common.domain.OrderProductDetail;
import my.edu.common.enumeration.OrderType;
import my.edu.common.validate.groups.Insert;
import my.edu.common.validate.groups.Sales;

import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = true)
public class PurchaseDetailOrderDTO extends OrderProductDetail {
    @Min(value = 0, message = "金额必须大于0", groups = {Insert.class, Default.class})
    @NotNull(message = "请填入购货单价", groups = {Insert.class})
    private BigDecimal purchasePrice; // 购货单价
    private Long warehouseId; // 仓库ID

    private String warehouseName;
    @Min(value = 0, message = "金额必须大于0", groups = {Insert.class, Default.class})
    private BigDecimal procurementCost; // 采购费用
    private String remark;

    @Override
    public BigDecimal getCurrentPrice() {
        return getPurchasePrice();
    }

    @Override
    public void setCurrentPrice(BigDecimal price) {
        setPurchasePrice(price);
    }

    @Override
    public OrderType getCurrentOrderType() {
        return OrderType.PURCHASE_PRICE;
    }

    //private Integer wholePackage;//整件散包
    //private Long purchaseOrderId;
}